// 1.个人中心头部
const Header = (resolve) => {
  import('src/header/header').then((module) => {
    resolve(module)
  })
}
// 2.个人中心头部2
const UserHeader = (resolve) => {
  import('src/header/user_header').then((module) => {
    resolve(module)
  })
}
// 1.个人信息
const UserInfo = (resolve) => {
  import('src/user/user_info').then((module) => {
    resolve(module)
  })
}
// 1.手机号设置
const MoblieSet = (resolve) => {
  import('src/user/user_info/mobile_set').then((module) => {
    resolve(module)
  })
}
// 1.更换手机号
const UpdateMobile = (resolve) => {
    import('src/user/user_info/mobile_set/update_mobile').then((module) => {
      resolve(module)
    })
}
// 2.输入新手机号
const NewMobile = (resolve) => {
  import('src/user/user_info/mobile_set/new_mobile').then((module) => {
    resolve(module)
  })
}
// 提现设置
const PresentSet = (resolve) => {
  import('src/user/user_info/present_set').then((module) => {
    resolve(module)
  })
}
// 选择提现设置
const ChangeCart = (resolve) => {
  import('src/user/user_info/present_set/change_cart').then((module) => {
    resolve(module)
  })
}
// 选择支付宝
const Alipay = (resolve) => {
  import('src/user/user_info/present_set/alipay').then((module) => {
    resolve(module)
  })
}
// 选择银行卡
const BankCard = (resolve) => {
  import('src/user/user_info/present_set/bank_card').then((module) => {
    resolve(module)
  })
}
// 基本信息
const BasicInfo = (resolve) => {
  import('src/user/user_info/basic_info').then((module) => {
    resolve(module)
  })
}
// 输入新名字
const NewName = (resolve) => {
  import('src/user/user_info/basic_info/new_name').then((module) => {
    resolve(module)
  })
}
// 支付设置
const PaymentSet = (resolve) => {
  import('src/user/user_info/payment_set').then((module) => {
    resolve(module)
  })
}
// 选择重置密码方式
const ResetPwd = (resolve) => {
  import('src/user/user_info/payment_set/reset_pwd').then((module) => {
    resolve(module)
  })
}
// 支付密码验证
const TestPwd = (resolve) => {
  import('src/user/user_info/payment_set/test_pwd').then((module) => {
    resolve(module)
  })
}
// 修改密码
const UpdatePwd = (resolve) => {
  import('src/user/user_info/payment_set/update_pwd').then((module) => {
    resolve(module)
  })
}
// 设置密码
const SetPwd = (resolve) => {
  import('src/user/user_info/payment_set/set_pwd').then((module) => {
    resolve(module)
  })
}
// 6.申请提现
const ShenqPresent = (resolve) => {
  import('src/user/shenq_present').then((module) => {
    resolve(module)
  })
}
// 更改提现账号
const UpdateCard = (resolve) => {
  import('src/user/shenq_present/update_card').then((module) => {
    resolve(module)
  })
}
// 7.订单明细列表
const OrderList = (resolve) => {
  import('src/user/order_details').then((module) => {
    resolve(module)
  })
}
// 7.订单明细详情
const OrderDetails = (resolve) => {
  import('src/user/order_details/order_details').then((module) => {
    resolve(module)
  })
}
// 8.登录
const Login = (resolve) => {
  import('src/user/login').then((module) => {
    resolve(module)
  })
}
// 登录信息填写
const LoginInfo = (resolve) => {
  import('src/user/login/login_info').then((module) => {
    resolve(module)
  })
}
// 支付页面
const Payment = (resolve) => {
  import('src/user/login/payment').then((module) => {
    resolve(module)
  })
}
// 审核刷新结果页面
const WaitRefresh = (resolve) => {
  import('src/user/login/wait_refresh').then((module) => {
    resolve(module)
  })
}
// 支付成功
const PaymentSuccess = (resolve) => {
  import('src/user/login/payment_succ').then((module) => {
    resolve(module)
  })
}
// 支付失败
const PaymentErr = (resolve) => {
  import('src/user/login/payment_err').then((module) => {
    resolve(module)
  })
}
// 审核资料提交
const SubmitInfo = (resolve) => {
  import('src/user/login/submit_info').then((module) => {
    resolve(module)
  })
}
// 用户协议
const UserAgree = (resolve) => {
  import('src/user/login/user_agree').then((module) => {
    resolve(module)
  })
}
export default [
  // 1.个人信息
  {
    path: '/user_info',
    meta: {title: '基本信息'},
    name: 'user_info',
    components: {
      content: UserInfo
    }
  },
  // 设置
  {
    path: '/basic_info',
    meta: {title: '基本信息'},
    name: 'basic_info',
    components: {
      // header: Header,
      content: BasicInfo
    }
  },
  // 设置
  {
    path: '/new_name',
    meta: {title: '基本信息'},
    name: 'new_name',
    components: {
      header: Header,
      content: NewName
    },
    beforeEnter: (to, from, next) => {
      // console.log(to,from)
      next()
    }
  },
  // 支付设置
  {
    path: '/payment_set',
    meta: {title: '支付设置'},
    name: 'payment_set',
    components: {
      // header: Header,
      content: PaymentSet
    }
  },
  // 提现设置
  {
    path: '/present_set',
    meta: {title: '账户管理'},
    name: 'present_set',
    components: {
      header: Header,
      content: PresentSet
    }
  },
  // 选择账户
  {
    path: '/change_cart',
    meta: {title: '选择账户'},
    name: 'change_cart',
    components: {
      header: Header,
      content: ChangeCart
    }
  },
  // 添加银行卡
  {
    path: '/bank_card',
    meta: {title: '添加银行卡'},
    name: 'bank_card',
    components: {
      header: Header,
      content: BankCard
    },
    beforeEnter: (to, from, next) => {
      if (from.name === 'present_set' && to.name === 'bank_card') {
        next('/user_info')
      } else {
        next()
      }
    }
  },
  // 添加支付宝
  {
    path: '/alipay',
    meta: {title: '添加支付宝'},
    name: 'alipay',
    components: {
      header: Header,
      content: Alipay
    },
    beforeEnter: (to, from, next) => {
      if (from.name === 'present_set' && to.name === 'alipay') {
        next('/user_info')
      } else {
        next()
      }
    }
  },
  // 手机号设置
  {
    path: '/mobile_set',
    meta: {title: '手机号设置'},
    name: 'mobile_set',
    components: {
      content: MoblieSet
    }
  },
  // 更换手机号
  {
    path: '/update_mobile',
    meta: {title: '更换手机号'},
    name: 'update_mobile',
    components: {
      header: Header,
      content: UpdateMobile
    }
  },
  // 更输入新手机号
  {
    path: '/new_mobile',
    meta: {title: '输入新手机号'},
    name: 'new_mobile',
    components: {
      header: Header,
      content: NewMobile
    }
  },
  // 选择重置密码方式
  {
    path: '/reset_pwd',
    meta: {title: '重置支付密码'},
    name: 'reset_pwd',
    components: {
      header: Header,
      content: ResetPwd
    }
  },
  // 支付密码验证
  {
    path: '/test_pwd',
    meta: {title: '重置支付密码'},
    name: 'test_pwd',
    components: {
      header: Header,
      content: TestPwd
    }
  },
  // 修改支付密码
  {
    path: '/update_pwd',
    meta: {title: '修改支付密码'},
    name: 'update_pwd',
    components: {
      header: Header,
      content: UpdatePwd
    }
  },
  // 修改支付密码
  {
    path: '/set_pwd',
    meta: {title: '设置密码'},
    name: 'set_pwd',
    components: {
      header: Header,
      content: SetPwd
    }
  },
  // 6.申请提现
  {
    path: '/shenq_present',
    meta: {title: '确认提现'},
    name: 'shenq_present',
    components: {
      content: ShenqPresent
    }
  },
  // 更改提现账号
  {
    path: '/update_card',
    meta: {title: '更换账户'},
    name: 'update_card',
    components: {
      header: Header,
      content: UpdateCard
    }
  },
  // 7.订单明细
  {
    path: '/order_list',
    meta: {title: '收支明细'},
    name: 'order_list',
    components: {
      header: Header,
      content: OrderList
    }
  },
  // 收支明细详情
  {
    path: '/order_details/:id',
    meta: {title: '收支明细'},
    name: 'order_details',
    components: {
      header: Header,
      content: OrderDetails
    }
  },
  // 登录
  {
    path: '/login',
    meta: {title: '登录'},
    name: 'login',
    components: {
      content: Login
    }
  },
  // 选择登录信息
  {
    path: '/login_info',
    meta: {title: '登录'},
    name: 'login_info',
    components: {
      header: UserHeader,
      content: LoginInfo
    }
  },
  // 选择登录信息
  {
    path: '/payment',
    meta: {title: '支付页面'},
    name: 'payment',
    components: {
      content: Payment
    }
  },
  //审核结果刷新页面
  {
    path: '/wait_refresh',
    meta: {title: '资料审核中'},
    name: 'wait_refresh',
    components: {
      header: Header,
      content: WaitRefresh
    }
  },
  // 用户协议
  {
    path: '/user_agree',
    meta: {title: '入会请愿书'},
    name: 'user_agree',
    components: {
      header: Header,
      content: UserAgree
    }
  },
  // 支付成功
  {
    path: '/payment_succ',
    meta: {title: '支付成功'},
    name: 'payment_succ',
    components: {
      header: UserHeader,
      content: PaymentSuccess
    }
  },
  // 支付失败
  {
    path: '/payment_err',
    meta: {title: '支付失败'},
    name: 'payment_err',
    components: {
      header: UserHeader,
      content: PaymentErr
    }
  },
  // 支付失败
  {
    path: '/submit_info',
    meta: {title: '审核资料提交'},
    name: 'submit_info',
    components: {
      header: Header,
      content: SubmitInfo
    }
  }
]
